{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4 if语句和自定义函数\n",
    "## 4.1 看下面的例子，学习if语句的规则：\n",
    "- 语法规则\n",
    "- 执行过程\n",
    "该算法的执行过程可以描述为流程图：\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# coding = utf-8\n",
    "score = input('please input your score\\n')\n",
    "iscore = int(score)\n",
    "if iscore >= 90:\n",
    "    print('you  are great')\n",
    "elif iscore >= 80:\n",
    "    print('you are good')\n",
    "elif iscore >=70:\n",
    "    print('you are normal')\n",
    "else:\n",
    "    print('you are not good')\n",
    "print('bye')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 4.2 自定义函数\n",
    "**函数**，是构成python语言最重要的要素。作为一类对象，python已经我们提供了大量的函数对象，通过调用这些对象，可以极大地扩展程序的功能。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
